package uk.ac.ebi.bioinvindex.model.impl;

import uk.ac.ebi.bioinvindex.model.impl.term.AnnotationType;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * User: Nataliya Sklyar (nsklyar@ebi.ac.uk)
 * Date: Dec 20, 2007
 */
@Entity
@Table(name = "annotation")

public class Annotation extends IdentifiableImpl {

	private AnnotationType type;

	private String text;

	public Annotation() {
	}

	public Annotation(AnnotationType type, String text) {
		this.type = type;
		this.text = text;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@ManyToOne(targetEntity = AnnotationType.class)
	@JoinColumn(name = "TYPE_ID", nullable = false)
	public AnnotationType getType() {
		return type;
	}

	protected void setType(AnnotationType type) {
		this.type = type;
	}
}
